package com.fangwaii.core.authorization;

import org.apache.shiro.authc.AuthenticationToken;

/**
 * @author lxc18
 * @date 2024/12/6 15:24
 * @description GatewayAuthenticationToken
 */
public class GatewayAuthenticationToken implements AuthenticationToken {
    private String channelId;
    private String token;

    public GatewayAuthenticationToken(String channelId, String token) {
        this.channelId = channelId;
        this.token = token;
    }

    @Override
    public Object getPrincipal() {

        //表示当前用户的身份，一般是用户名或者用户ID
        return this.channelId;
    }

    @Override
    public Object getCredentials() {
        //表示当前用户的凭证，一般是密码或者其他凭证信息
        return this.token;
    }
}
